package com.qianyue.组合模式;

/**
 * 菜单
 *
 * @author qian yue
 * @version v1.0.0
 * @since 2025/2/4 13:37
 */
public abstract class MenuComponent {
    protected String name;
    protected int level;

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public MenuComponent(String name, int level) {
        this.name = name;
        this.level = level;
    }

    public void add(MenuComponent menuComponent) {
        throw new UnsupportedOperationException();
    }

    public void remove(MenuComponent menuComponent) {
        throw new UnsupportedOperationException();
    }

    public abstract void print();
}
